/**
 * @file key_params.h
 * @brief 
 * @author  ()
 * @version 1.0
 * @date 2024-09-13
 * @ingroup flash
 * @copyright Copyright (C) 2019 Queclink Wireless Solutions (ShenZhen) Co., Ltd. All Rights Reserved.
 * 
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version <th>Author  <th>Description
 * <tr><td>2024-09-13 <td>1.0     <td>     <td>内容
 * </table>
 */
#ifndef _KEY_PARAMS_H_
#define _KEY_PARAMS_H_

#include <stdbool.h>
#include <stdio.h>
#include <string.h>

#include "flash/flash_main.h"
#include "aadl/public.h"
#include "aadl/flash.h"
#include "aadl/flash/flash_if.h"

#ifdef __cplusplus
extern "C" {
#endif


#define DIRECT_FOTA_FLAG_OFFSET     0
#define DIRECT_PIN_OFFSET           512
#define DIRECT_ICCID_OFFSET         (548)
#define DIRECT_IMEI_OFFSET          (580)
#define DIRECT_GNSSCFG_OFFSET       728

#define DIRECT_APN_OFFSET           764
// #define DIRECT_NPS_OFFSET           1024  //用来存储ZJ手机号码，鉴权码等等
#define DIRECT_IP_OFFSET            1064
#define DIRECT_PWD_OFFSET           1276
#define DIRECT_SN_OFFSET            8
#define DIRECT_AES_OFFSET           2000    /* AES加密秘钥 */
#define DIRECT_ATUTO_APN_OFFSET     2200   //自动APN参数地址，80字节



bool load_key_params(int32_t offset, unsigned char *buf, int32_t len, int32_t crc_offset);
bool save_key_params(int32_t offset, unsigned char *buf, int32_t len, int32_t crc_offset);

#ifdef __cplusplus
}
#endif

#endif // __KEY_PARAMS_H


